#' connect cityRE house price database.
#'
#' This function connect cityRE house price database.
#' @param host character.the host address of database server
#' @param dbname character.the name of database
#' @param user character.the name of user
#' @param password character.the password of database
#' @export
#' @return a Mysql connection object
#' @examples
#' ######connect database###
#' con<-connectDB()
#' dbListTables(con) # check talbes in db
#' sqlcmd<-'select * from ha_info limit 5'
#' ha_info<-dbGetQuery(con,sqlcmd)
connectDB<-function(host="192.168.3.139",dbname="niek_160906",
                    user="niek",password="FbWf8AKC"){
  library(RMySQL)
  con <- dbConnect(MySQL(),host=host,
                   dbname=dbname,user=user,password=password)
  dbListTables(con) # check talbes in db
  sqlcmd.utf8<-'SET NAMES utf8'
  dbSendQuery(con,sqlcmd.utf8)
  con
}

